package com.onlineMIS.common;

import java.util.List;

import com.onlineMIS.ORM.entity.chainS.user.ChainUserInfor;
import com.onlineMIS.ORM.entity.headQ.user.UserInfor;

/**
 * session信息模型
 * 
 * @author 孙宇
 * 
 */
public class SessionInfo implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4221264015564298180L;
	private int userId;// 用户ID
	/**
	 * 1:总部用户, 2：连锁店用户
	 */
	public static int USER_TYPE_HEADQ = 1;
	public static int USER_TYPE_CHAIN = 2;
	private int userType;
	/**
	 * 用户属于千禧还是禧乐仓
	 */
	private int userBelongTo;
	private String userName;// 用户登录名
	private String name; //客户名字
	private String ip;// 用户IP
	private int myChainId; //客户的连锁店id

	private List<String> resourceList;// 用户可以访问的资源地址列表

	public SessionInfo(UserInfor user) {
		this.setName(user.getName());
		this.setUserId(user.getUser_id());
		this.setUserType(USER_TYPE_HEADQ);
		this.setUserName(user.getUser_name());
	}
	
	public SessionInfo(ChainUserInfor user) {
		this.setName(user.getName());
		this.setUserId(user.getUser_id());
		this.setUserType(USER_TYPE_HEADQ);
		this.setUserName(user.getUser_name());
	}

	public int getMyChainId() {
		return myChainId;
	}

	public void setMyChainId(int myChainId) {
		this.myChainId = myChainId;
	}

	public List<String> getResourceList() {
		return resourceList;
	}

	public void setResourceList(List<String> resourceList) {
		this.resourceList = resourceList;
	}
	


	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getUserBelongTo() {
		return userBelongTo;
	}

	public void setUserBelongTo(int userBelongTo) {
		this.userBelongTo = userBelongTo;
	}

	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public int getUserType() {
		return userType;
	}

	public void setUserType(int userType) {
		this.userType = userType;
	}

}
